796975697ae8d3b7c064914a5cafcfa0014ba660
2 class SVGTest
extends MediaWikiTestCase
{
4 protected function setUp() {
7 $this->filePath
= __DIR__
. '/../../data/media/';
9 $this->setMwGlobals( 'wgShowEXIF', true );
11 $this->backend
= new FSFileBackend( array(
12 'name' => 'localtesting',
13 'lockManager' => 'nullLockManager',
14 'containerPaths' => array( 'data' => $this->filePath
)
16 $this->repo
= new FSRepo( array(
18 'url' => 'http://localhost/thumbtest',
19 'backend' => $this->backend
22 $this->handler
= new SVGHandler
;
26 * @param $filename String
27 * @param $expected Array The expected independent metadata
28 * @dataProvider providerGetIndependentMetaArray
30 public function testGetIndependentMetaArray( $filename, $expected ) {
31 $file = $this->dataFile( $filename, 'image/svg+xml' );
32 $res = $this->handler
->getCommonMetaArray( $file );
34 $this->assertEquals( $res, $expected );
37 public function providerGetIndependentMetaArray() {
39 array( 'Tux.svg', array(
40 'ObjectName' => 'Tux',
41 'ImageDescription' => 'For more information see: http://commons.wikimedia.org/wiki/Image:Tux.svg',
43 array( 'Wikimedia-logo.svg', array() )
47 private function dataFile( $name, $type ) {
48 return new UnregisteredLocalFile( false, $this->repo
,
49 "mwstore://localtesting/data/$name", $type );